/*
 * @Author: yanyqf
 * @Date: 2020-04-28 12:51:19
 * @LastEditTime: 2020-05-08 16:35:52
 * @Description: file content
 */
/**
 * @title 表格
 * @description 单选
 *
 */
import React, { Component } from "react";
import cloneDeep from 'lodash.clonedeep';

import Modal from 'bee-modal';
import 'bee-modal/build/Modal.css';

import { Button, Icon } from "tinper-bee";

import Table from "bee-table";
import 'bee-table/build/Table.css';
import Checkbox from 'bee-checkbox';
import 'bee-checkbox/build/Checkbox.css';
import FormControl from 'bee-form-control';
import 'bee-form-control/build/FormControl.css';

import isEqual from "lodash.isequal"
import { vendorsSetStorage, vendorsGetStorage, vendorsDanger, vendorsFmtDate, vendorsGetUrlParam } from 'utils/config.js';
import axios from 'axios';

import './index.less'



class MyTable extends Component {
    constructor(props) {
        super(props);
        let _self = this;
        this.state = {
            ...props
        }
    }
    componentWillReceiveProps(nextProps) {
        if (!isEqual(nextProps.data, this.props.data)) {
            console.log(222222222222222222222222222222)
            this.setState({
                data: nextProps.data
            })
        }
    }
    render() {
        return (
            <Table
                columns={this.state.columns}
                data={this.state.data}
                onRowDoubleClick={this.state.onRowDoubleClick}
                onRowClick={this.state.onRowClick}
                emptyText={() => '暂无数据'}
                rowKey={this.state.rowKey}
                scroll={{ y: 380 }}
            />

        );
    }
}
export default MyTable;